// import React from 'react';
// import ReactDOM from 'react-dom';
// import Counter1 from './components/Counter1';
// import Counter2 from './components/Counter2';
// import { Provider } from './react-redux';
// import store from './store';


// ReactDOM.render(
//     <Provider store={ store }>
//         <Counter1 />
//         <Counter2 />
//     </Provider>,
//     document.getElementById('root')
// );

import store from './store';
store.subscribe(() => console.log(store.getState()));
// 测试logger中间件
store.dispatch({type: 'ADD1'})
// 测试chunk中间件
store.dispatch((dispatch, getState) => {
    setTimeout(() => {
        dispatch({type: 'ADD1'});
    }, 3000)
})
// 测试promise中间件
store.dispatch(new Promise((resolve, reject) => {
    setTimeout(() => {
        resolve({type: 'ADD1'});
    }, 2000)
}))
